type point=record
  x,y:longint;
end;
var cnt,n,i,j,ln,iy1,iy2:longint; k,b,y1,y2:real;
    p:array[1..10000] of point;
function calck(x1,y1,x2,y2:real):real;
begin
  calck:=(y1-y2)/(x1-x2);
end;
function calcb(x1,y1,k:real):real;
begin
  calcb:=y1-(x1*k);
end;
begin
  readln(n);
  for i:=1 to n do readln(p[i].x,p[i].y);
  ln:=p[1].y;
  cnt:=0;
  for i:=2 to n do
    begin
      k:=calck(p[i-1].x,p[i-1].y,p[i].x,p[i].y);
      b:=calcb(p[i].x,p[i].y,k);
        for j:=p[i-1].x+1 to p[i].x do
          begin
            y1:=k*j+b; y2:=2*ln-y1;
            if y1=trunc(y1) then dec(cnt);
            iy1:=trunc(y1); iy2:=trunc(y2);
            cnt:=cnt+iy1-iy2;
          end;
    end;
  writeln(cnt+1);
end.
